//package  com.txts.admin.app.device.controller;
//
//import  com.txts.admin.app.device.model.dto.SOSRequestDTO;
//import  com.txts.admin.app.device.model.dto.SafeReportDTO;
//import  com.txts.admin.app.device.model.query.DeviceSearchQuery;
//import  com.txts.admin.app.device.service.DeviceService;
//import com.txts.base.common.domain.ResponseDTO;
//import io.swagger.v3.oas.annotations.Operation;
//import lombok.RequiredArgsConstructor;
//import org.springframework.web.bind.annotation.*;
//
//import io.swagger.v3.oas.annotations.tags.Tag;
//
//import jakarta.validation.Valid;
//
//
///**
// * 设备前端控制层
// *
// * @author baoyr
// * @since 2025-07-17 10:48
// */
//@Tag(name = "设备接口")
//@RestController
//@RequestMapping("/api/v1/device")
//@RequiredArgsConstructor
//public class DeviceController {
//
//    private final DeviceService deviceService;
//
//
//    /**
//     * 搜索设备
//     */
//    @Operation(summary = "搜索设备")
//    @PostMapping("/search")
//    public ResponseDTO<> searchDevices(@RequestBody DeviceSearchQuery query) {
//        return ResponseDTO.ok(deviceService.searchDevices(query));
//    }
//
//    /**
//     * 获取设备详情
//     */
//    @Operation(summary = "获取设备详情")
//    @GetMapping("/{deviceId}")
//    public ResponseDTO<> getDeviceDetail(@PathVariable Long deviceId) {
//        return ResponseDTO.ok(deviceService.getDeviceDetail(deviceId));
//
//    }
//
//    /**
//     * 连接设备
//     */
//    @Operation(summary = "连接设备")
//    @PostMapping("/{deviceId}/connect")
//    public ResponseDTO<> connectDevice(@PathVariable Long deviceId) {
//        return ResponseDTO.ok(deviceService.connectDevice(deviceId));
//
//    }
//
//    /**
//     * 断开设备连接
//     */
//    @Operation(summary = "断开设备连接")
//    @PostMapping("/{deviceId}/disconnect")
//    public ResponseDTO<> disconnectDevice(@PathVariable Long deviceId) {
//        return ResponseDTO.ok(deviceService.disconnectDevice(deviceId));
//
//    }
//
//
//    /**
//     * 发送报平安消息
//     */
//    @Operation(summary = "发送报平安消息")
//    @PostMapping("/safe-report")
//    public ResponseDTO<> sendSafeReport(@Valid @RequestBody SafeReportDTO reportDTO) {
//        return ResponseDTO.ok(deviceService.sendSafeReport(reportDTO));
//
//    }
//
//    /**
//     * 发送SOS求救
//     */
//    @Operation(summary = "发送SOS求救")
//    @PostMapping("/{deviceId}/sos")
//    public ResponseDTO<> sendSOS(@RequestBody SOSRequestDTO sosDTO) {
//        return ResponseDTO.ok(deviceService.sendSOS(sosDTO));
//    }
//
//}
//package  com.txts.admin.app.device.controller;
//
//import  com.txts.admin.app.device.model.dto.SOSRequestDTO;
//import  com.txts.admin.app.device.model.dto.SafeReportDTO;
//import  com.txts.admin.app.device.model.query.DeviceSearchQuery;
//import  com.txts.admin.app.device.service.DeviceService;
//import com.txts.base.common.domain.ResponseDTO;
//import io.swagger.v3.oas.annotations.Operation;
//import lombok.RequiredArgsConstructor;
//import org.springframework.web.bind.annotation.*;
//
//import io.swagger.v3.oas.annotations.tags.Tag;
//
//import jakarta.validation.Valid;
//
//
///**
// * 设备前端控制层
// *
// * @author baoyr
// * @since 2025-07-17 10:48
// */
//@Tag(name = "设备接口")
//@RestController
//@RequestMapping("/api/v1/device")
//@RequiredArgsConstructor
//public class DeviceController {
//
//    private final DeviceService deviceService;
//
//
//    /**
//     * 搜索设备
//     */
//    @Operation(summary = "搜索设备")
//    @PostMapping("/search")
//    public ResponseDTO<> searchDevices(@RequestBody DeviceSearchQuery query) {
//        return ResponseDTO.ok(deviceService.searchDevices(query));
//    }
//
//    /**
//     * 获取设备详情
//     */
//    @Operation(summary = "获取设备详情")
//    @GetMapping("/{deviceId}")
//    public ResponseDTO<> getDeviceDetail(@PathVariable Long deviceId) {
//        return ResponseDTO.ok(deviceService.getDeviceDetail(deviceId));
//
//    }
//
//    /**
//     * 连接设备
//     */
//    @Operation(summary = "连接设备")
//    @PostMapping("/{deviceId}/connect")
//    public ResponseDTO<> connectDevice(@PathVariable Long deviceId) {
//        return ResponseDTO.ok(deviceService.connectDevice(deviceId));
//
//    }
//
//    /**
//     * 断开设备连接
//     */
//    @Operation(summary = "断开设备连接")
//    @PostMapping("/{deviceId}/disconnect")
//    public ResponseDTO<> disconnectDevice(@PathVariable Long deviceId) {
//        return ResponseDTO.ok(deviceService.disconnectDevice(deviceId));
//
//    }
//
//
//    /**
//     * 发送报平安消息
//     */
//    @Operation(summary = "发送报平安消息")
//    @PostMapping("/safe-report")
//    public ResponseDTO<> sendSafeReport(@Valid @RequestBody SafeReportDTO reportDTO) {
//        return ResponseDTO.ok(deviceService.sendSafeReport(reportDTO));
//
//    }
//
//    /**
//     * 发送SOS求救
//     */
//    @Operation(summary = "发送SOS求救")
//    @PostMapping("/{deviceId}/sos")
//    public ResponseDTO<> sendSOS(@RequestBody SOSRequestDTO sosDTO) {
//        return ResponseDTO.ok(deviceService.sendSOS(sosDTO));
//    }
//
//}
